package com.h2cloud.config;

import com.h2cloud.interceptor.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @PackageName: com.h2cloud.config
 * @ClasssName: InterceptorConfig
 * @Author: h2cloud
 * @Date: 2021/3/10 13:10
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        System.out.println("配置token");
        registry.addInterceptor(new JWTInterceptor())
                .addPathPatterns("/blog/**");
    }
}
